import { createRouter, createWebHistory } from "vue-router";

//引入常量路由
import { constantRoutes } from "./constantRoutes";

//引入所有的异步路由
import { allAsyncRouter } from "./allAsyncRouter";

//先加入通用路由
let routes = [...constantRoutes, ...allAsyncRouter];

// //动态路由
// export const DynamicRouters = [
//   {
//     path: "/",
//     name: "根布局",
//     component: () => import("@/views/layout/index"),
//     hidden: true,
//     meta: {
//       //有些页面是否登录认证
//       requiresAuth: true,
//       name: "根布局",
//     },
//     //子路由
//     children: [],
//   },
// ];

// 路由
const router = createRouter({
  history: createWebHistory(),
  scrollBehavior: () => ({ y: 0 }),
  routes,
});

// 导出
export default router;
